"""
@Data : 2025/7/27 16:32
@Author : apache
@File : commenrDao.py
@Action : 微博评论信息 数据访问对象
"""
from util import dbUtil


def getAllComment():
    """
    获取所有评论信息
    :return: 评论信息列表
    """
    con = None
    try:
        con = dbUtil.getCon()
        cursor = con.cursor()
        sql = "select * from t_comment where text_raw is not null"
        cursor.execute(sql)
        result = cursor.fetchall()
        return result
    except Exception as e:
        print(f"Error: {e}")
        con.rollback()
        return None
    finally:
        dbUtil.closeCon(con)
